$.get("http://127.0.0.1:5000/blog/article_page", data => {
    console.log(data);
    let obj = {}
    data.forEach((ele, i) => {
        let str = ele.publishTime.substring(0, 7)
        if (obj[str]) {
            obj[str].push(ele)
        } else {
            obj[str] = [ele]
        }
    });
    let st = ''
    for (let key in obj) {
        st += `
            <li>
                <h2>${key}</h2>
            </li>
        `
        obj[key].forEach(val => {
            st += `
            <li>
                <img src="./img/05.jpg" alt="">
                <a href="./details.html?id=${val.id}">
                    <time>${val.publishTime}</time>
                    <div class="title">${val.title}</div>
                </a>
            </li>
            `
        })
    }
    $('.timeline').html($('.timeline').html() + st)
})